package com.example.hdx.controller;


import com.example.hdx.entity.Articles;
import com.example.hdx.mapper.ArticlesMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/Articles")
public class ArticlesController {

    @Autowired
    private ArticlesMapper ArticlesMapper;

    @GetMapping("")
    public List<Articles> getAllArticles() {
        List<Articles> ArticlesList = ArticlesMapper.getAllArticles();
        return ArticlesList;

    }
}
